#import "NSError+JSONSerializer.h"

#import "JSONResponseSerializerWithData.h"

@implementation NSError (JSONSerializer)

- (id)customErrorData {
    NSData *data = self.userInfo[JSONResponseSerializerWithDataKey];
    if (data) {
        return [NSJSONSerialization JSONObjectWithData:data
                                               options:kNilOptions
                                                 error:nil];
    } else {
        return nil;
    }
}

@end
